package com.android.music.prolyric;

import java.util.ArrayList;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class listAdapter  extends ArrayAdapter<String> 
{
	Activity context;
	ArrayList<String> items;
	int color;
	public listAdapter(Activity aContext, ArrayList<String> items,int color) 
	{
		super(aContext, R.layout.simple_list_item_lyr, items);
		context = aContext;
		this.items = items;
		this.color=color;
	}
	
	public View getView(int position, View convertView, ViewGroup parent) 
	{
	
		View row = convertView;
		if (row == null) 
		{
			LayoutInflater inflater = (LayoutInflater) context	.getLayoutInflater();
			row = inflater.inflate(R.layout.simple_list_item_lyr, null);		
		}
		
		TextView text = (TextView) row.findViewById(R.id.tvLyric);
		text.setTextColor(color);
		text.setText(items.get(position));
		
		return row;
	}
}